#ifndef _WITHITEMTYPE_H_
#define _WITHITEMTYPE_H_
#include "SimpleNode.h"
class IVisitor;
class WithItemType;
typedef QSharedPointer<WithItemType> WithItemTypePtr;

class WithItemType: public SimpleNode
{
public:
    explicit WithItemType(int nodeId=-1);
    virtual ~WithItemType();
    
    
    
    virtual QString type() const;
    virtual QString toString() const;
    virtual void accept(IVisitor* visitor, const SimpleNodePtr& node);
    virtual void traverse(IVisitor* visitor);
private:
};



typedef QListIterator<WithItemTypePtr> WithItemTypePtrListIterator;

class WithItemTypeList: public QList<WithItemTypePtr>
{
public:
    inline WithItemTypeList() { }
    inline explicit WithItemTypeList(WithItemTypePtr i) { append(i); }
    inline WithItemTypeList(const WithItemTypeList &l) : QList<WithItemTypePtr>(l) { }
    inline WithItemTypeList(const QList<WithItemTypePtr> &l) : QList<WithItemTypePtr>(l) { }

    inline WithItemTypeList operator+(const WithItemTypeList &other) const
    { WithItemTypeList n = *this; n += other; return n; }
    inline WithItemTypeList &operator<<(WithItemTypePtr it)
    { append(it); return *this; }
    inline WithItemTypeList &operator<<(const WithItemTypeList &l)
    { *this += l; return *this; }

    QString toString() const
    {
        QString str("WithItemTypeList(");
        foreach(WithItemTypePtr it, *this){
            if (it != NULL){
                str += it->toString()+",";
            }
        }
        str += ")";
        return str;
    }

    void traverse(IVisitor* visitor)
    {
        foreach(WithItemTypePtr it, *this){
            if (it != NULL){
                it->accept(visitor, it);
            }
        }
    }
};



#endif